package online.foxnull2.foxmall.cart.controller;

import online.foxnull2.foxmall.cart.service.CartService;
import online.foxnull2.foxmall.cart.vo.cart.CartItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CartController {

    private final CartService cartService;

    @Autowired
    public CartController(CartService cartService) {
        this.cartService = cartService;
    }

    @GetMapping("/list/cartItem")
    public List<CartItem> listCartItem() {
        return cartService.listCartItem();
    }
}
